//
//  BHMyFunDetailInfoCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/30.
//

import UIKit

class BHMyFunDetailInfoCell: UITableViewCell {
    
    @IBOutlet weak var name_label: UILabel!
    
    @IBOutlet weak var starDate_label: UILabel!
    
    @IBOutlet weak var place_label: UILabel!
    
    @IBOutlet weak var price_label: UILabel!
    
    @IBOutlet weak var area_distance_label: UILabel!
    
    
    @IBOutlet weak var type_name_label: UILabel!
    
    var model: BHUserFunApplyDetailModel! {
        didSet {
            self.name_label.text = model.name
            self.starDate_label.text = model.beginTime
            self.place_label.text = model.venueName
            if model.distance.isEmpty == true || model.distance == "0" || model.distance == "0.0"{
                self.area_distance_label.text = model.areaName
            }else {
                if BHLocationManager.shared.authed == true {
                    self.area_distance_label.text = "\(model.distance)m \(model.areaName)"
                }else {
                    self.area_distance_label.text = model.areaName
                }
            }
            
            if model.ifFee == 1 { // 需要报名费
                self.price_label.text = "¥\(model.price)"
            }else {
                self.price_label.text = "无需报名费"
            }
            
            self.type_name_label.text = " \(model.typeTwoLabel)    "
        }
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    static var funHeight: CGFloat {
        get {
            return 120
        }
    }
    
}
